package com.lgq.controller;

import com.lgq.bean.Institute;
import com.lgq.bean.Message;
import com.lgq.service.InstituteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @program: stu_info_manager
 * @description:
 * @author: Lin
 * @create: 2019-01-05 00:13
 **/
@Controller
public class InstituteController {

    /**
     * 自动装配instituteService
     */
    @Autowired
    private InstituteService instituteService;

    /**
     * 获取全部学院信息
     * @return
     */
    @ResponseBody
    @RequestMapping(value = "/institutes")
    public Message getInstitutes(){
        List<Institute> list=instituteService.getInstitutes();
        return Message.success().add("institutes",list);
    }

}
